/**
 * 字符串最后一个单词长度
 */
function lastWordLength(str) {
    let tempArr = str.split(' ')
    return tempArr.pop().length
}

/**
 * 计算字符出现次数
 */
function countChar(str, char) {
    let count = 0
    for (let i = 0; i < str.length; i++) {
        if (str[i] === char) {
            count++
        }
    }
    return count
}

/**
 * 去重与排序
 */
function repeatSort(arr) {
    let tempArr = []
    for (let i = 0; i < arr.length; i++) {
        if (!tempArr.includes(arr[i])) {
            tempArr.push(arr[i])
        }
    }
    return tempArr.sort()
}

/**
 * 字符串分割
 */
function strSplit(str) {
    let a = str.length % 8
    if (a !== 0) {
        for (let i = 0; i < 8 - a; i++) {
            str += '0'
        }
    }
    let j = 0
    while (str[j]) {
        console.log(str.substring(j, j + 8))
        j = j + 8
    }
}
const words = readline()
console.log(lastWordLength(words))